#include "widget.h"
#include <QApplication>
#include "facedetector.h"
#include <opencv2/core/core.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <QDebug>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    FaceDetector *detector=new FaceDetector;
    qDebug()<<"before init";
    QImage image("D:\\Project\\Test\\LearningOpenCV\\lena.jpg");
    if(detector->Init())
    {
        detector->DoDetect(image);
    }
/*
    cv::VideoCapture cap(0);

    if(cap.isOpened()&&detector->Init())
    {
        qDebug()<<"INited";
        while(1)
        {
            cv::Mat frame;
            cap>>frame;
            if(frame.empty())
                continue;
            detector->DoDetect(frame);
            qDebug()<<"show";
            cv::imshow("face",frame);
            if(cv::waitKey(30)>=0)
                break;
        }
    }
*/
    return a.exec();
}
